refactored the delete to support framework