     {:noreply, state}
   end
 
-  def handle_info({:nerves_uart, port, message}, state)
-    when !Map.has_key?(state, port) do
-
-    {:noreply, state}
-  end
-
-  def handle_info({:nerves_uart, port, message}, state)
-    when Map.has_key?(state, port) do
-
-    {point_type, new_settings} = next_settings(Map.get(state, port))
-
-    case point_type do
-      :crest, :trough ->
+  def handle_info({:nerves_uart, port, message}, state) do
+    if Map.has_key?(state, port) do
+      {point_type, new_settings} = next_settings(Map.get(state, port))
+
+      if point_type == :crest or point_type == :trough do
         Logger.info(message)
-
-      _ ->
-    end
-
-    new_state = Map.put(state, port, new_settings)
-    {:noreply, new_state}
+      end
+
+      new_state = Map.put(state, port, new_settings)
+      {:noreply, new_state}
+    else
+      {:noreply, state}
+    end
   end
 
   def handle_info(msg, state) do

          count: 0,
          direction: -1
        }
        {:ok, settings}

      {:error, error} ->

      case teardown(Map.get(state, port)) do
        :ok ->
          new_state = Map.delete(state, port)
          {:reply, :ok, new_state}

        {:error, error} ->
          {:reply, {:error, error}, state}
      end
    else
      # @todo return different error atom
      {:reply, {:error, :ebadf}, state}
    end
  end

