speed up fsm performance