     func generateProjectAndTargets(project: PBXProject,
                                    identifiers: [String]) {
         // Project
-        if project.reference.temporary {
-            project.reference.fix(generate(identifiers: identifiers))
-        }
+        project.fixReference(identifiers: identifiers)
 
         // Targets
         let targets: [PBXTarget] = project.targetReferences.objects()
         targets.forEach { target in
 
             var identifiers = identifiers
-            identifiers.append(String(describing: target))
             identifiers.append(target.name)
 
-            if target.reference.temporary {
-                target.reference.fix(generate(identifiers: identifiers))
-            }
+            target.fixReference(identifiers: identifiers)
         }
     }
 

    fileprivate func generateTargetReferences(_ target: PBXTarget,
                                              identifiers: [String]) throws {
        var identifiers = identifiers
        identifiers.append(String(describing: target))
        identifiers.append(target.name)

        // Configuration list

    fileprivate func generateGroupReferences(_ group: PBXGroup,
                                             identifiers: [String]) throws {
        var identifiers = identifiers
        if let groupName = group.fileName() {
            identifiers.append(groupName)
        }

        // Group
        group.fixReference(identifiers: identifiers)

        // Children
        try group.childrenReferences.forEach { child in
