Refactor to use requests instead of urllib2