refactoring router model