             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

  #    set of buckets

  # The ordered record contains a single bucket
  ordered_threshold = 8

  defrecordp :ordered,
    size: 0,
    bucket: []

  # The bucketed record contains a series of buckets.
  expand_load = 5
  contract_load = 2
  node_bitmap = 0b111
  node_shift = 3
  node_size = 8
  node_template = :erlang.make_tuple(node_size, [])
  node_escaped = Macro.escape(node_template)

  defrecordp :trie,
    size: 0,
    depth: 0,
    expand_on: node_size * expand_load,
    contract_on: contract_load,
    root: node_template

  import Bitwise


  defp dict_put(trie(root: root, depth: depth, size: size, expand_on: size, contract_on: contract_on) = dict, key, value) do
    root = node_expand(root, depth, depth + 1)
    dict = trie(dict, root: root, depth: depth + 1,
      expand_on: size * @node_size, contract_on: contract_on * @node_size)
    dict_put(dict, key, value)
  end

