Created UI class and moved all user interaction to it.