Refactor binary search tree with NullObject pattern.