improved postprocessing query