 
   @type state :: State.t
 
-  # Client
-
   def start_link(%State{} = state, opts \\ []) do
     state = State.on_start(state)
     GenServer.start_link(__MODULE__, {:suspend, state}, opts)
   end
 
-  def resume(pid) do
-    GenServer.call(pid, :resume)
-  end
-
-  def pause(pid) do
-    GenServer.call(pid, :pause)
-  end
-
-  def next(pid) do
-    GenServer.call(pid, :next)
-  end
-
-  def prev(pid) do
-    GenServer.call(pid, :prev)
+  def get_state(pid) do
+    GenServer.call(pid, :get_state)
   end
 
   def get_status(pid) do
     GenServer.call(pid, :get_status)
   end
 
-  # Server (callbacks)
-
-  # Calls
-  def handle_call(:pause, _from, {:cont, state}) do
-    {:reply, :ok, {:suspend, state}}
-  end
-
-  # calling pause on an already paused or stopped game has no effect
-  def handle_call(:pause, _from, state) do
-    {:reply, :ok, state}
-  end
-
-  def handle_call(:resume, _from, {:suspend, state}) do
-    tick(state)
-    {:reply, :ok, {:cont, state}}
-  end
-
-  # calling resume on an already running game or stopped game doesn't do
-    # anything
-  def handle_call(:resume, _from, state) do
-    {:reply, :ok, state}
+  def handle_call(:get_status, _from, {status, _} = state) do
+    {:reply, status, state}
   end
 
   def handle_call(:next, _from, {:halted, state}) do

  def handle_call(:next, _from, {_, state}) do
    state = step(state)
    {:reply, :ok, {:suspend, state}}
  end

  def handle_call(:prev, _from, {:halted, state}) do

  end

  def step_back(%{hist: []} = s), do: s

  def step_back(state) do
    state
    |> prev_turn
    |> State.on_change()
  end

  defp apply_reducer(%{world: w, reducer: f} = state) do
    %{state| world: f.(w)}
  end

  defp delay(state) do
    opts = state.opts
    Keyword.fetch!(opts, :delay)
  end

  defp prev_turn(state) do
    [h|t] = state.hist
    state = put_in state.world, h
    put_in(state.hist, t)
  end

  defp save_history(%{world: h} = state) do
    update_in state.hist, fn t ->
      [h |Enum.take(t, @max_history)]
    end
  end

  defp tick(state) do
    Process.send_after(self(), :tick, delay(state))
  end
