Make an iterated query stub reusable