Improving iterate helper, via @rragan