Make queryengine a cached class.