fixed optimizations