Make delete task more general.