Refactor code
Fix ForeignParagraph aligned_graph reassignment