Begin tidying UI code