added abstract class for state machines.