queries redesign