Refactor nested context handler into Router.Context