topdoc parsing functionality is separated out by itself