Refactor getReducedDocuments
Add Index class