refactor StateMachineLite