GenerateBagOfWords in Subject and design pattern