Abstracting getting response from given URL into factory method