Update to use iterator.