main config refactoring