expose each as top-level function