Refactor delete EntityObject