Add iterator pattern to unify array and collection.