Added protocol data and refactoring