Refactoring the GUI. Work in progress.