major btree refactor