move the router to a separate lib