Refactoring, fix in HttpUrlConnectionMethods, proper tests