Balanced Binary Tree refactor