Cleaning up preferences-related code.
8 files changed