rewrite the routers and controllers