cleaner rewrite