Refactoring view to delete a document