change the design of iterator