#346 Optimize iterate implementation