Refactor HTTP Request and testing.