optimize delete command