Refactor BST level iterator