[wip] add doc-comments (and refactor)