refactor remove_paragraphs