state changes array further refactoring