router refactoring