generic's code generation