Refactored BinaryTree class.