type wrapping of functions