Refactors route helper to share code between page_path and page_url