Optimized classes generation