Remove global scope assumptions in client and exec code in non global scope

Change-Id: I0722413d09a48e4d54680ea5888e419fc7e9075e
Merge "Remove global scope assumptions in client and exec code in non global scope"