rewrite tools