extract 'prep-scripting-container' function