Some refactoring of GUI was needed