GUI: Refactoring of the gui.