Using visitors to generate the index