Use is_module_loaded() to test these to avoid code duplication.