rewrite categories