refactoring analytics for tweets