Refactoring of the methods in the BST