Modified base query class to iterate properties more efficiently.