helper method used in controller