Added state pattern