refactor index.DOMDocument.php