Analyzing duplicating and modifying document elements