update code gen for twins