Rewrite categories