BST code clean up