state change array refactoring toward map/reduce use