slightly upgraded UI code