refactoring state pattern methods, and so on.