Clean a bit the protocol_helper.js code (still dirty)