improve export of state machine