- refactored data access calls out of the view and into the controller