If rewrite