http request builder refactoring + tests