Get rid of some ugly globals

Bug: 49066
Change-Id: I76236034ec6f0c73766b2105cf346b13bac45780
Merge "Get rid of some ugly globals"