Tidy up and create UI class

No real changes