Finally, satisfied with the pfn wrapper (including recursive stuff).