replace much iterator code with for-each