Connected prefs with code