Improved protocol and connection API.