rejig totally to use QueryContext