refactoring delete