Additions to controller, added a helper method to simplify controller.