merge deletion function together