update with some bug fix for document and adhoc provisioning profile
update with refactory documentservice