refactored context and route internals to support Params type