refactor architecture with nested routes and other changes