refactoring for testability

we can now better inject http request and client
mocks, this brings better testing and flexibility
of the code.. more to come