making the the template Index generic