XXX refactor, document, V2 protocol support