Refactor BTree insert.