Redesign mappers and gateways to handle batch processing