ENH: Save user settings with qsettings and refactoring