refactor twitter_analytics.js