why StringIO / readline, and not just `doc.splitlines()[0]`?