Afsin generator code cleaning