lib/cpp: cleaning up protocols