Remove mutability from code generator

No need for mutability here