Maybe if the extensoin would set a parameter with the swiftmailer handler ids in the container we could just read it out here, delete it, and loop over thoes ids instead of looping over everything. That sounds faster and more robust too.