small refactor of httpAdapter