Improve bulk delete function