tests and refactoring for application helper methods