refactor and delete item