helper reflection added to extract the generic type for a field