eliminate a few thousand queries with some well-crafted iterations