Using iterators.
To throw exceptions instead printing messages.