Refactor delete process