Refactor some models and controllers.