Refactoring controller manager.