Optimizations

Optimizations related to variable use