minor FSM refactoring