refine gather data query