Separated ID generating from the constructor and writer classes.