class for sorting user preferences in the db