sentiment analysis refactor