Refactoring changes to route all pages from root index page