optimize initial script