Tidied up structure of common UI stuff