improve handling of type arguments