refactoring documentation and adding index