refactor class generators using asm