extract immutable B-tree stack class