refactored some controllers.