Optimized Generate model