Adjust document structure