Entity state pattern