Refactoring how config is loaded