 
 extension DynamicSettingCategoryViewController: DynamicSettingCellDelegate {
 
-    typealias SettingConfig = (indexPath: NSIndexPath, value: Bool, setting: DynamicSetting)
+    typealias SettingConfig = (setting: DynamicSetting, indexPath: NSIndexPath, value: Bool, isVisible: Bool)
 
     func toggleSetting(setting: DynamicSetting, value: Bool) {
         guard let nav = self.navigationController as? ElloNavigationController,
             currentUser = currentUser,
             category = self.category else { return }
+        let settings = category.settings
 
-        let visibility = category.settings.enumerate().map { (index, setting) in
+        let visibility = settings.enumerate().map { (index, setting) in
             return (
+                setting: setting,
                 indexPath: NSIndexPath(forRow: index, inSection: 0),
                 value: currentUser.propertyForSettingsKey(setting.key),
-                setting: category.settings[index]
+                isVisible: DynamicSettingCellPresenter.isVisible(setting: setting, currentUser: currentUser)
             )
         }
 

            })
    }

    func settingChanged(config: SettingConfig, user: User) -> Bool {
        return DynamicSettingCellPresenter.isVisible(setting: config.setting, currentUser: user) ||
            user.propertyForSettingsKey(config.setting.key) != config.value
    }

    func deleteAccount() {

                nav.setProfileData(user)

                let changedPaths = visibility.filter { config in
                    return self.settingChanged(config, user: user)
                }.map { config in
                    return config.indexPath
                }
