few changes about optimizations