major refactor of indexes