Updated methods to iterate over collections.