simplify protocol code