handleMode no longer mutates shared state without statechanges