Refactor the controller object