transfer structure to TreeNode