Optimized the scripts.