             root: root,
             size: size - 1,
             depth: depth - 1,
-            contract_on: div(size, unquote(node_size)),
-            expand_on: div(trie(dict, :expand_on), unquote(node_size)))
+            contract_on: div(size, @node_size),
+            expand_on: div(trie(dict, :expand_on), @node_size))
         else
           trie(dict, size: size - 1, root: root)
         end

  end

  defp bucket_index(hash) do
    hash &&& unquote(node_bitmap)
  end

  defp bucket_nth_index(hash, n) do
    (hash >>> (unquote(node_shift) * n)) &&& unquote(node_bitmap)
  end

  defp bucket_next(hash) do
    hash >>> unquote(node_shift)
  end

  ## Node helpers

  end

  defp node_contract({ b1, b2, b3, b4, b5, b6, b7, b8 }, 1, n) do
    @node_template |> each_contract(b1, n) |> each_contract(b2, n) |> each_contract(b3, n)
                   |> each_contract(b4, n) |> each_contract(b5, n) |> each_contract(b6, n)
                   |> each_contract(b7, n) |> each_contract(b8, n)
  end

  defp each_contract(acc, { b1, b2, b3, b4, b5, b6, b7, b8 }, n) do
    acc |> node_relocate(b1, n) |> node_relocate(b2, n) |> node_relocate(b3, n)
        |> node_relocate(b4, n) |> node_relocate(b5, n) |> node_relocate(b6, n)
        |> node_relocate(b7, n) |> node_relocate(b8, n)
  end

  defp node_relocate(node // @node_template, bucket, n) do
    :lists.foldl fn { key, value }, acc ->
      pos = key |> bucket_hash() |> bucket_nth_index(n)
      set_elem(acc, pos, bucket_put!(elem(acc, pos), key, value))
