slight improvements to delete functionality