moved the gateway to a separate Lua package