Updated generator to have type as a field value