Better deleteWhen definnition