clean index function. cache and retrieve repo data