refacto index statements