state pattern finished