use TreeNode where possible