Refactoring.
Added the delete case.