 
   def handle_cast({:new_heading, theta}, ship) do
     if valid_theta?(theta) do
-      new_ship = %{ship | :target_theta => normalize_radians(theta)}
-      {:noreply, new_ship}
+      {:noreply, %{ship | target_theta: normalize_radians(theta)}}
     else
       {:noreply, ship}
     end

  @doc """
  Player requests turn to given theta.
  """
  def new_heading(ship_id, theta) do
    GenServer.cast(via(ship_id), {:new_heading, theta})
  end

  @doc """
  Move the ship to a random position on the map
  and prevent it firing.
  """
  def hyperspace(ship_pid) when is_pid(ship_pid) do
    GenServer.cast(ship_pid, :hyperspace)
  end

  def hyperspace(ship_id) do
    GenServer.cast(via(ship_id), :hyperspace)
  end

  @doc """
  Remove the ship from the game.

  Player pulls trigger, which may fire a bullet
  if the ship is recharged.
  """
  def player_pulls_trigger(ship_id), do: GenServer.cast(via(ship_id), :player_pulls_trigger)

  def game_state(ship_id), do: GenServer.call(via(ship_id), :game_state)

  # GenServer callbacks

