More work on Query class