R: refactor docs