refactoring of prefs_site_run functions