config, controller refactoring