Main class and UI constructor