Pulled some logic out of the view and into the controller
Merge remote-tracking branch 'origin/master'