Optimized the way scripts are loaded.