added code generator for field