implemented flag to preserve raw generic types