refactoring for routes file