Refactor Markdown text into a Text class.