add support for context and add some extra middleware