Upgrade to the new query engine