Enhance Function casting