   def recv({:ok, conn}, fun), do: recv(conn, fun)
   def recv(%Conn{socket: {:gen_tcp, socket}, timeout: timeout} = conn, fun) do
     receive do
-      {:tcp, ^socket, stanza} ->
+      {:tcp, ^socket, data} ->
         :inet.setopts(socket, active: :once)
-        {:ok, conn, stanzas} = parse_stanza(conn, stanza)
+        {:ok, conn, stanzas} = parse_data(conn, data)
         fun.(conn, stanzas)
       {:tcp_closed, ^socket} ->
         {:error, :closed}
       {:tcp_error, ^socket, reason} ->
         {:error, reason}
     after timeout ->
-      _ = Kernel.send(self, {:error, :timeout})
+      Kernel.send(self, {:error, :timeout})
       conn
     end
   end
   def recv(%Conn{socket: {:ssl, socket}, timeout: timeout} = conn, fun) do
     receive do
-      {:ssl, ^socket, stanza} ->
+      {:ssl, ^socket, data} ->
         :ssl.setopts(socket, active: :once)
-        {:ok, conn, stanzas} = parse_stanza(conn, stanza)
+        {:ok, conn, stanzas} = parse_data(conn, data)
         fun.(conn, stanzas)
       {:ssl_closed, ^socket} ->
         {:error, :closed}
       {:ssl_error, ^socket, reason} ->
         {:error, reason}
     after timeout ->
-      _ = Kernel.send(self, {:error, :timeout})
+      Kernel.send(self, {:error, :timeout})
       conn
     end
   end

    %{conn | parser: parser}
  end

  defp parse_stanza(%Conn{jid: jid, owner: owner, parser: parser} = conn, data) do
    {:ok, parser, stanzas} = :exml_stream.parse(parser, data)
    for stanza <- stanzas do
      Logger.debug fn -> "[#{jid}][INCOMING] #{inspect Romeo.XML.encode!(stanza)}" end
      _ = Kernel.send owner, {:stanza_received, stanza}
    end
    {:ok, %Conn{conn | parser: parser}, stanzas}
  end

  def send(%Conn{jid: jid, socket: {mod, socket}} = conn, stanza) do

  end
  def handle_message(_, _), do: :unknown

  defp handle_data(data, %{socket: socket} = conn) do
    :ok = activate(socket)
    {:ok, _conn, _stanza} = parse_data(conn, data)
  end

  defp activate({:gen_tcp, socket}) do
