factor out Lua type