Genericised BST structure