Change batch type from Int to Long to fix stack overflow when the sequential strategy is used + code clean up