Moving 'iterate' out of class