added ability to specify count for generated types that allow it