perf(fsm): Avoid allocation while changing state