anchor.diff:      {ok, StateName, State}.
   
   %%%
  -%%% Utility functions
  +%%% Auxiliary functions
   %%%
   
  -send_data(Port, Data) ->
  -    send_data(Port, Data, true).
  -
   send_data(Port, Data, WithTimer) ->
  -    try port_command(Port, Data) of
  -        true ->
  -            case WithTimer of
  -                true ->
  -                    Timer = gen_fsm:send_event_after(?CALL_TIMEOUT, timeout),
  -                    {ok, Timer};
  -                false ->
  -                    ok
  -            end
  +    try {port_command(Port, Data), WithTimer} of
  +        {true, true} ->
  +            {ok, gen_fsm:send_event_after(?CALL_TIMEOUT, timeout)};
  +        {true, false} ->
  +            ok
       catch
           error:badarg ->
               fail
  
positive.code:         Response ->
              {'e', {error, Response, []}}
      end,
      Data = encode(R),
      case send_data(Port, Data, false) of
          ok ->
              {next_state, StateName, State#state{call=undefined}};
          fail ->
  
negative.code:     end,
      {stop, Error, State}.
  
  encode(Term) ->
      term_to_binary(Term, [{minor_version, 1}]).
  
  foreach_in_queue(Fun, Queue) ->
      case queue:out(Queue) of
          {empty, Queue} ->
              ok;
          {{value, Item}, Queue2} ->
              Fun(Item),
              foreach_in_queue(Fun, Queue2)
      end.
  