~ adapted state pattern logic