added better handling for extended types