refactoring routing