improve doc parsing