More improvement on the lua generation. Altough a major rework will be required