Implement Preference class.