A bit of refactoring for the UI classes..