refactor doc generation