Refactoring on urllib2 mocking