Refactor bst_iterator