Improve the type safety of the allocator class
Improve the type safety of tree nodes