Balanced binary search tree init, refactoring