Move ResetStates to common code.