state machines with observers