some GUI code cleaning