Tidy up controller and model