More refactoring of config