Added tree rewriter