Refactore class ButtonState to ExerciseState.