move router to handlers
add factory for router