Update to query parsing