persional code factory with C