refactoring
replace code for indexing to main repo, refactoring