Introduced the state pattern