Please refactor to server markdown util (takes a markdown extractor and a doc)