gui, code cleanup