Remove unneeded use of global variables

Change-Id: If486cafcf7bba3ed43839d7e400f88d741aa945b
Merge "Remove unneeded use of global variables"