delegate some work to lua space (less cross-bounds calls)