     is_active = Keyword.get(opts, :active, true)
 
     response = call_port(state, :open, {name, opts})
-    new_state = %{state | name: name,
-              controlling_process: from_pid,
-              rx_framing_timeout: new_rx_framing_timeout,
-              is_active: is_active} |>
-              change_framing(new_framing)
+    new_state = change_framing(
+      %{state | name: name,
+                controlling_process: from_pid,
+                rx_framing_timeout: new_rx_framing_timeout,
+                is_active: is_active},
+      new_framing
+    )
 
     {:reply, response, new_state}
   end

    #IO.puts "Received data on port #{state.name}"
    {rc, messages, new_framing_state} =
      apply(state.framing, :remove_framing, [data, state.framing_state])
    new_state = %{state | framing_state: new_framing_state} |>
      handle_framing_timer(rc)

    if state.controlling_process do
      Enum.each(messages, &(report_message(new_state, &1)))

    {:ok, messages, new_framing_state} =
      apply(state.framing, :frame_timeout, [state.framing_state])

    new_state = notify_timedout_messages(
      %{state | rx_framing_tref: nil, framing_state: new_framing_state},
      messages
    )

    {:noreply, new_state}
  end
