       Path.join(data_dir, "#{inspect root}")
     end
 
-    @spec memoize(Genomu.key, t) :: t
-    def memoize(key, __MODULE__[snapshot: snapshot, clock: clock, log: log] = state) do
-      :ets.insert(snapshot, {key, clock})
-      state.log([{key, ITC.encode_binary(clock)}|log])
+    @spec memoize(Genomu.key, binary, t) :: t
+    def memoize(key, rev, __MODULE__[snapshot: snapshot, log: log] = state) do
+      :ets.insert(snapshot, {key, rev})
+      state.log([{key, rev}|log])
     end
 
     @spec lookup(Genomu.key, t) :: nil | ITC.t
     def lookup(key, __MODULE__[snapshot: snapshot]) do
       case :ets.lookup(snapshot, key) do
         [] -> nil
-        [{^key, clock}] -> ITC.encode_binary(clock)
+        [{^key, rev}] -> rev
       end
     end
 

  defp next_clock(clock, Genomu.Command[type: :get]), do: clock
  defp next_clock(clock, _), do: ITC.event(clock)

  @spec memoize(Genomu.key, Genomu.command, ITC.t, State.t) :: State.t
  defp memoize(_key, Genomu.Command[type: :get], _clock, state) do
    state
  end
  defp memoize(key, _cmd, clock, State[] = state) do
    state.clock(clock).memoize(key)
  end

  defp ensure_snapshot(State[snapshot: nil] = state) do

    coord_options = [for: cmd] |>
                    Keyword.merge(options)
    result = Genomu.Coordinator.run(coord_options)
    state = memoize(key, cmd, clock, revision, state)
    {:reply, result, state}
  end

