Lots of logic in the controller