UI cleanliness improvements; added some unit tests