Refactor delete