Simplified variable generation
Various optimizations