UI code improvements