add exception if XSD is NULL, and remove duplicate system_settings_form code