improved performance on script