Refractor UI class into 4 classes