remove reentrant Lua code