More GUI code cleanup