Change mode and optimized script