Refactor the router and create a route interface