clean room rewrite