refactored InvertedIndex as Singleton