refactored batch_update