Controller cleanup

Some of the logic in the controller should have been in the model