Refactoring delete method