overview of the state pattern 7071911