THis function should have a less generic name since it just extracts the types referred to