Moved all UI vars and functions to UI class