Use more iterators, and a lifetime.