optimize: made _parse_host_port and _parse_dsn local functions.