Add options to generated code, make cb optional