Move protocol-dependent functions to factories