Rewrite groups