minor query cleanup