Removes unused resources.