Used simpler queries for m2m clearing when possible.