Moved the config loading into it's own function