Refactored deleteAction