refactoring, GUI updated