Refactoring loading config