         i += newChildren.length - 1
       break if rangeIsEmpty
 
-    if @children.length > BRANCHING_THRESHOLD
-      splitIndex = Math.ceil(@children.length / BRANCHING_THRESHOLD)
-      [new Node(@children.slice(0, splitIndex)), new Node(@children.slice(splitIndex))]
+    if newNodes = @splitIfNeeded()
+      newNodes
     else
       addSet(@ids, ids)
       return

        else
          relativeStart = position.traversalFrom(childStart)
          if splitNodes = child.splice(relativeStart, oldExtent, newExtent, exclusiveIds, precedingIds)
            @children.splice(i - 1, 1, splitNodes...)
          remainderToDelete = spliceOldEnd.traversalFrom(childEnd)
          childEnd = childStart.traverse(child.extent)

      if @children[i - 2]?.shouldMergeWith(child)
        @children.splice(i - 2, 2, @children[i - 2].merge(child))
        i--

      precedingIds = child.ids

    if @children.length > BRANCHING_THRESHOLD
      splitIndex = Math.ceil(@children.length / BRANCHING_THRESHOLD)
      [new Node(@children.slice(0, splitIndex)), new Node(@children.slice(splitIndex))]

  getStart: (id) ->
    return unless @ids.has(id)

      child = @children[i]
      childStart = childEnd
      childEnd = childStart.traverse(child.extent)

      switch childEnd.compare(position)
        when -1 then childPrecedesRange = true
