rewriting tests without using iterators