preparing codegen for pattern classes