Changed interface to use iterable instead of iterator