small improvement for isGenerator check