anchor.diff:  code_change(_OldVsn, State, _Extra) ->
   	{ok, State}.
   
  --spec handle_async(ReplyInfo, State) -> ok
  +-spec pending_result(ReplyInfo, EventManager, Handler) -> ok
   	when
   		ReplyInfo :: tuple(),
  -		State :: state().
  -%% @doc Handle async result of httpc:request/3.
  -%% @private
  -handle_async(ReplyInfo, #state{estabslished = false, pending = true} = State) ->
  -	case gen_event:call(ocs_event_log, ocs_event_log, ReplyInfo) of
  +		EventManager :: pid(),
  +		Handler :: gen_event_log.
  +%% @doc Handle async result of httpc:request/5 while session pending.
  +%% @private
  +pending_result(ReplyInfo, EventManager, Handler) ->
  +	case gen_event:call(EventManager, Handler, ReplyInfo) of
   		ok ->
   			ok;
   		{error, _Reason} ->
   			error_logger:warning_report(["Event shipping failed",
  -					{module, ?MODULE}, {state, State}]),
  -			gen_event:delete_handler(ocs_event_log, ocs_event_log, [])
  -	end;
  -handle_async({_RequestId,
  -		{{_HttpVersion, StatusCode, _ReasonPhrase}, _Headers, _Body}}, _State)
  +					{module, ?MODULE}, {manager, EventManager}, {handler, Handler}]),
  +			gen_event:delete_handler(EventManager, Handler, [])
  +	end.
  +
  +-spec established_result(ReplyInfo) -> ok
  +	when
  +		ReplyInfo :: tuple().
  +%% @doc Handle async result of httpc:request/5 while session established.
  +%% @private
  +established_result({_RequestId,
  +		{{_HttpVersion, StatusCode, _ReasonPhrase}, _Headers, _Body}})
   		when StatusCode >= 200, StatusCode  < 300 ->
   	ok;
  -handle_async({RequestId,
  -		{{_HttpVersion, StatusCode, _ReasonPhrase}, _Headers, _Body}}, State) ->
  -	error_logger:warning_report(["Event shipping failed",
  -			{module, ?MODULE}, {state, State},
  -			{status, StatusCode}, {request, RequestId}]),
  +established_result({RequestId,
  +		{{_HttpVersion, StatusCode, ReasonPhrase}, _Headers, _Body}}) ->
  +	error_logger:warning_report(["Event shipping failed",
  +			{module, ?MODULE},
  +			{status, StatusCode}, {reason, ReasonPhrase},
  +			{request, RequestId}]),
   	gen_event:delete_handler(ocs_event_log, ocs_event_log, []);
  -handle_async({RequestId, {error, Reason}}, State) ->
  -	error_logger:warning_report(["Event shipping failed",
  -			{module, ?MODULE}, {state, State},
  +established_result({RequestId, {error, Reason}}) ->
  +	error_logger:warning_report(["Event shipping failed",
  +			{module, ?MODULE},
   			{error, Reason}, {request, RequestId}]),
   	gen_event:delete_handler(ocs_event_log, ocs_event_log, []).
   
  
positive.code: handle_event1(Request, Profile,
  		#state{estabslished = false, pending = false} = State) ->
  	NewState = State#state{estabslished = false, pending = true},
  	MFA = {?MODULE, handle_async, [NewState]},
  	Options = [{sync, false}, {receiver, MFA}],
  	case httpc:request(post, Request, [], Options, Profile) of
  		{ok, RequestId} when is_reference(RequestId) ->
  
negative.code: 	end;
  handle_event1(Request, Profile,
  		#state{estabslished = true, pending = false} = State) ->
  	MFA = {?MODULE, established_result, []},
  	Options = [{sync, false}, {receiver, MFA}],
  	case httpc:request(post, Request, [], Options, Profile) of
  		{ok, RequestId} when is_reference(RequestId) ->
  