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

Change-Id: I651ff4901ce3ddf948763a49b793ded5448b7b7f
Merge "Remove global scope assumptions in repo and exec code in non global scope"