Simplify the lookup-inspect function.
Simplify and de-complect the middleware.