The if condition (which might be there in other places) was added to incrementally change the codebase.
Going over the code now, I think you are right - port is always specified.

Will change to host + ":" + port