Optimize delete/undelete/approve logic