add much more optimized generator