cosmetic changes to query()