Added a Prefs class to simplify preferences handling