Rewriting to Akka FSM