more refactoringof gui