test refactoring, to make it easier to test alternate http client impls