let on_factory name f = let o = try get_factory name with Not_found -> failwith (Printf.sprintf "View factory %s not found" name) in f o