simplified code, not working due to TypeExtractor issues