refactoring of gui