Contextualize middleware.