   def handle_resp_timeout(pdu, st) do
     case Pdu.same?(pdu, st.pdu) and st.state == :wait_for_resp do
       true ->
-        GenServer.reply(st.from, :timeout)
-        do_set_free(st)
+        reply(st.from, :timeout)
+        {:ok, set_free(st)}
       false ->
-        do_push_to_waiting({:timeout, pdu}, st)
+        {:ok, push_to_waiting({:timeout, pdu}, st)}
     end
   end
 
   @doc false
   def handle_pdu(pdu, st) do
-    do_push_to_waiting({:pdu, pdu}, st)
-  end
-
-  @doc false
-  def handle_stop(_reason, _los_pdus, st) do
+    {:ok, push_to_waiting({:pdu, pdu}, st)}
+  end
+
+  @doc false
+  def terminate(_reason, _los_pdus, st) do
     case st.from do
       nil -> :nop
-      from -> GenServer.reply(from, :stop)
+      from -> reply(from, :stop)
     end
     {:normal, st}
   end


  """
  def request(esme, pdu, timeout \\ @default_timeout) do
    try do
      ESME.call(esme, {:request, pdu}, timeout)
    catch
      :exit, {:timeout, _} -> :timeout
    end
  end

  @type awaited :: {:pdu, pdu :: Pdu.t} | {:resp, resp_pdu :: Pdu.t, original_pdu :: Pdu.t} | {:timeout, pdu :: Pdu.t} | {:error, pdu :: Pdu.t, reason :: any}


  """
  def wait_for_pdus(esme, timeout \\ @default_timeout) do
    call(esme, :wait_for_pdus, timeout)
  end

  @spec pdus(esme :: pid, timeout) :: [awaited]
