Rewrite Preference class to make it more simple to use and maintain