move HTTP(S)Connection to separate file