A better class based fsm.