Make generator more performant