add context field to generated class