clean rewrite