Code reorganization for preferences.