optimize execute script