model edited , state pattern added