Code for state pattern