Reworked the function public API