Replaced lists with iterators where appropriate