reducing Query class