extract TreeNode and ListNode to sperate files