executing encapsulated scripts in the same process