Rewrite class defs