Added configStateMachine and unit tests