Refactor Http class
Fix unit test