add controller helper method to refactor code