router refactor