Refactor delete routines.