anchor.diff:                                               {stop, any(), any(), #state{}}.
   handle_call({add, OwnerJID, ForeignJID, ClientSession, ServerSession},
               _From, #state{route_db=Routes} = State) ->
  -    Ref = make_ref(),
  -    ets:insert(Routes, {exmpp_jid:to_list(OwnerJID), 
  -                        ForeignJID, 
  -                        {client, ClientSession}, 
  -                        Ref}),
  -    ets:insert(Routes, {exmpp_jid:to_list(ForeignJID),
  -                        OwnerJID,
  -                        {server, ServerSession},
  -                        Ref}),
  -    ets:insert(Routes, {exmpp_jid:bare_to_list(OwnerJID),
  -                        exmpp_jid:bare(ForeignJID), 
  -                        {client, ClientSession}, 
  -                        Ref}),
  -    ets:insert(Routes, {exmpp_jid:bare_to_list(ForeignJID), 
  -                        exmpp_jid:bare(OwnerJID), 
  -                        {server, ServerSession}, 
  -                        Ref}),
  +    add_entry(Routes, OwnerJID, ForeignJID, ClientSession, ServerSession),
       {reply, ok, State};
   
   handle_call(free, _From, #state{route_db=Routes} = State) ->
  
positive.code: get(From, To) ->
      gen_server:call(?MODULE, {get, From, To}).
  
  %% Various helpers
  
  -spec get_entry(route_db(), any()) -> list().
  get_entry(Routes, Key) when is_list(Key) ->
  
negative.code: 
  handle_call(get_state, _From, #state{route_db=Routes} = State) ->
      {reply, {state, {route_db, Routes}}, State};
  
  handle_call({update, Old, New}, _From, #state{route_db=Routes} = State) ->
      [{Old, OwnerJID, {server, ServerSession}, Ref}] = get_entry(Routes, Old),
      JID = exmpp_jid:to_list(OwnerJID),
      [{JID, _Old, {client, ClientSession}, Ref}] = get_entry(Routes, JID),
      ForeignJID = exmpp_jid:parse(New),
      del_entry(Routes, [Ref]),
      add_entry(Routes, OwnerJID, ForeignJID, ClientSession, ServerSession),
      {reply, ok, State};
  
  handle_call(_Msg, _From, State) ->
      {reply, unexpected, State}.
  