nit but I think this would be clearer (or at least require less context) if you conditioned on the arity of cb