Refactor the commonmark converter class