rewrite approach