Clean up redundant iteration code.