moved method to ApplicationHelper