Refactor preferences.