restruct tree