private void removeEmptyStructures() throws CancelledException {

		for (Structure badStructure : badFIDStructures) {

			monitor.checkCancelled();

			ListAccumulator<LocationReference> accumulator = new ListAccumulator<>();

			boolean discoverTypes = true;
			ReferenceUtils.findDataTypeReferences(accumulator, badStructure, program, discoverTypes,
				monitor);

			List<LocationReference> referenceList = accumulator.asList();
			if (referenceList.isEmpty()) {
				// delete empty class data type and empty parent folders
				removeEmptyStructure(badStructure.getDataTypePath().getCategoryPath(),
					badStructure.getName());
			}
		}
	}
Method to remove the incorrectly applied and unreferenced empty structures that are not used
@throws CancelledException when script is cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java