Refactoring of SuffixArray class