Generator\oneOf is a function not a generator
Remove duplication