refactor protocole