route: refactor the router