Refactored TreeNode to an interface