Factor out protocol copying