anchor.diff:  
   -spec get_stanza_safe(client(), timeout()) -> {error, timeout} | {exml_stream:element(), metadata()}.
   get_stanza_safe(Client, Timeout) ->
  -    get_stanza_safe(Client, Timeout, none).
  -
  --spec get_stanza_safe(client(), timeout(), filter_pred()) ->
  +    get_stanza_safe(Client, Timeout, fun(_) -> true end).
  +
  +-spec get_stanza_safe(client(), timeout(), stanza_pred()) ->
       {error, timeout} | {exml_stream:element(), metadata()}.
   get_stanza_safe(Client, Timeout, Pred) ->
  -    receive_stanzas(Client, Timeout, fun(Stanza, Metadata) ->
  -                                             case Pred =:= none orelse Pred(Stanza) of
  -                                                 true -> {finish, {Stanza, Metadata}};
  -                                                 false ->
  -                                                     handle_received_stanza(Client, Stanza, Metadata),
  -                                                     continue
  -                                             end
  -                                     end).
  +    Handler = fun(Stanza, Metadata) ->
  +                      case Pred(Stanza) of
  +                          true -> {finish, {Stanza, Metadata}};
  +                          false ->
  +                              handle_received_stanza(Client, Stanza, Metadata),
  +                              continue
  +                      end
  +              end,
  +    receive_stanzas(Client, Timeout, Handler).
   
   -spec wait(client(), timeout()) -> ok.
   wait(Client, Timeout) ->
  -    {error, timeout} = receive_stanzas(Client, Timeout, fun(Stanza, Metadata) ->
  -                                                                handle_received_stanza(Client, Stanza, Metadata),
  -                                                                continue
  -                                                         end),
  +    Handler = fun(Stanza, Metadata) ->
  +                      handle_received_stanza(Client, Stanza, Metadata),
  +                      continue
  +              end,
  +    {error, timeout} = receive_stanzas(Client, Timeout, Handler),
       ok.
   
   -spec wait_forever(client()) -> no_return().
  
positive.code: 
  -type filter_pred() :: fun((exml_stream:element()) -> boolean()) | none.
  -export_type([filter_pred/0]).
  
  -type stanza_handler() :: fun((client(), exml_stream:element(), metadata()) -> boolean())
                          | fun((client(), exml_stream:element()) -> boolean()).
  
negative.code: get_stanza_with_metadata(Client, Name, Timeout) ->
      get_stanza_with_metadata(Client, Name, Timeout, fun(_) -> true end).
  
  -spec get_stanza_with_metadata(client(), any(), timeout(), stanza_pred()) ->
                                        {exml_stream:element(), metadata()}.
  get_stanza_with_metadata(Client, Name, Timeout, Pred) ->
      case get_stanza_safe(Client, Timeout, Pred) of
  