BBtree construction and related changes