There is duplication with IndexCommitRef and SegmentInfosRef - extract a generalized class and make it a top level class.