Simplify implementation of bst