Separated main and GUI, refactored dialogs