Fixing broken links and refactoring  for proper doc generation