rewrite tree node