heavy use of stateful.lua