added some helper methods to the controller