Refactor settingsDialog