cloned code to get stronger types for Fusion