Cleanup generation code of ctxt.

Signed-off-by: zosrothko <zosrothko@orange.fr>