Refactor default_port_for_scheme()