refactoring IndexReader.readIndex()