better query management