Refactored the QueryExport form.