fix add metadatafilereference for type's parent types
minor refactor for generate metadatafilereference collection