Also handling delete and undelete now.