separated prepare to build ua object and request object
show error message if decoding fail
refacotred tests: mock anything, and return all(stdout, stderr and result)