Iterator pattern applied to  objects