move router to lib