Removes bad practice public var
Abstracting code from onCreate in mainactivity
Adds a new global variable to the application