refactor the router to it's own module