Combine common preference code
Minor comment edit