Improve rewriter support