fsm improvments