Can't we isolate all of this to CSettings::Save() ?