Improved NGramHandler