type extraction for functions now works great