added FiniteStateMachine (factory) class