Improve handling of iterator, to make calling of hasNext() optional (or should it throw an exception?)