Stopwords detection refactoring