anchor.diff:          PID -> PID
       end.
   
  -%@doc get hbs process in the context of a client process
  --spec get_hbs(comm:mypid()) -> pid().
  -get_hbs(Pid) ->
  -    %% normalize for the table entry (just distinguish nodes)
  -    FDPid = comm:get(fd, Pid),
  -    case ets:lookup(fd_hbs, FDPid) of
  -        [] -> % synchronously create new hb process
  -            comm:send_local(my_fd_pid(), {create_hbs, Pid, self()}),
  -            receive {create_hbs_reply, NewHBS} -> NewHBS end;
  -        [Res] -> element(2, Res)
  -    end.
  -
  -%@doc start a new hbs process inside the fd process context (ets owner)
  --spec start_and_register_hbs(comm:mypid()) -> pid().
  -start_and_register_hbs(Pid) ->
  -    FDPid = comm:get(fd, Pid),
  -    case ets:lookup(fd_hbs, FDPid) of
  -        [] ->
  -            NewHBS = element(2, fd_hbs:start_link(pid_groups:my_groupname(), Pid)),
  -            ets:insert(fd_hbs, {FDPid, NewHBS}),
  -            NewHBS;
  -        [Res] -> element(2, Res)
  -    end.
  +%% @doc start a new hbs process inside the fd process context (ets owner)
  +%%      precond: FDPid points to the fd process at the target node
  +-spec start_and_register_hbs(FDPid::comm:mypid()) -> pid().
  +start_and_register_hbs(FDPid) ->
  +    {ok, NewHBS} = fd_hbs:start_link(pid_groups:my_groupname(), FDPid),
  +    pdb:set({FDPid, NewHBS}, fd_hbs),
  +    NewHBS.
   
   -spec forward_to_hbs(comm:mypid(), comm:message()) -> ok.
   forward_to_hbs(Pid, Msg) ->
  -    case ets:lookup(fd_hbs, comm:get(fd,Pid)) of
  -        %% [] -> hbs not yet started. This should not happen, as all
  -        %% execution paths before this call should invoke the hbs
  -        %% synchronously. Let gen_component report the error.
  -        [Entry] ->
  -            HBSPid = element(2, Entry),
  -            comm:send_local(HBSPid, Msg);
  -        [] ->
  -            log:log(info,
  -                    "[ FD ] outdated message? No hbs found to forward msg: ~p~n" ++ "Message dropped.", [Msg])
  -    end, ok.
  +    FDPid = comm:get(fd, Pid),
  +    HBSPid = case pdb:get(FDPid, fd_hbs) of
  +                 undefined -> % synchronously create new hb process
  +                     start_and_register_hbs(FDPid);
  +                 Entry -> element(2, Entry)
  +             end,
  +    comm:send_local(HBSPid, Msg).
  
positive.code: on({pong, RemHBSSubscriber, RemoteDelay}, State) ->
      ?TRACE("FD: pong, ~p~n", [RemHBSSubscriber]),
      forward_to_hbs(RemHBSSubscriber, {pong_via_fd, RemHBSSubscriber, RemoteDelay}),
      State;
  
  on({add_watching_of_via_fd, Subscriber, Pid}, State) ->
  
negative.code: -spec unsubscribe(comm:mypid() | [comm:mypid()], cookie()) -> ok.
  unsubscribe([], _Cookie)         -> ok;
  unsubscribe(GlobalPids, Cookie) when is_list(GlobalPids) ->
      FD = my_fd_pid(),
      _ = [begin
               comm:send_local(FD, {del_subscriber_via_fd, self(), Pid, Cookie})
           end
           || Pid <- GlobalPids],
      ok;
  