refactor btree impl.