changed introspection of collection to determine class