Remove unused code in protocol.py