Lua Interface: Refactor