refactor protocol helper. more docs.