refactored delete