Split out the query engine.