rewrite Phase IV plus switch to nested routes