Rewriting collections