extracted formatting logic into dedicated class DocFormatter