batch method now generic for any collection on server and client