implemented prefs usage