CORE-4270: converted the route definitions to functions so that their evaluation can be delayed until runtime