state pattern update