Preventing unnecessary closure capture of the incrementor functions during serialization by moving them to their own classes.