Major optimization for script runs