Added type-safe function type