start refactoring `make_index`