refacto batch_tokens