Refactored deletion feature