Updated script execution to use context object