refactoring the way how config loading works