What I mean is to "move" these differences inside socketHttpConnect function, so that functions becomes a single "entry point" for socket HTTP connections.