Utility Functions# make_cfg_dict Helper function to create a config dictionary if a list is provided.