Extracted serial number generator into a module for use by other classes.