Replaced more complex iterator usages.