Improvements to delete functionality