bulk processing code