Refactor indexMaker