adapting new code gen