new GUI and first refactoring