Add finish callback function to common generate helper