Since ScriptingOptions dont change you should define them outside of the foreach loops to improve efficiency