moving doc loading to service, broke internal links in the process