introduce MessageBatch class instead of ArrayList<>