More idiomatic delete handling code.