     
     // MARK: - Helpers
     
-    private func handleUnitTests() {
-        print("\n\(Color.Magenta)--- [Unit Tests]")
-        enumerateCurrentPath(appendingPathComponent: "\(oldName) Tests")
+    private func validatePath(_ path: String) -> Bool {
+        let projectPath = path.appending("/\(oldName).xcodeproj")
+        let workspacePath = path.appending("/\(oldName).xcworkspace")
+        let isValid = fileManager.fileExists(atPath: projectPath) || fileManager.fileExists(atPath: workspacePath)
+        return isValid
     }
     
-    private func handleUITests() {
-        print("\n\(Color.Magenta)--- [UI Tests]")
-        enumerateCurrentPath(appendingPathComponent: "\(oldName) UITests")
-    }
-    
-    private func handleMainTarget() {
-        print("\n\(Color.Magenta)--- [Main Target]")
-        enumerateCurrentPath(appendingPathComponent: oldName)
-    }
-    
-    private func handleProjectFile() {
-        print("\n\(Color.Magenta)--- [Project File]")
-        enumerateCurrentPath(appendingPathComponent: "\(oldName).xcodeproj")
-    }
-    
-    private func enumerateCurrentPath(appendingPathComponent pathComponent: String) {
-        let currentPath = fileManager.currentDirectoryPath
-        let path = currentPath.appending("/\(pathComponent)/")
-        
-        enumerateDirectory(atPath: path)
-        renameItem(atPath: path)
-    }
-    
-    private func enumerateDirectory(atPath path: String) {
-        print("\n\(Color.Yellow)- DIRECTORY: \(path)")
-        
+    private func enumeratePath(_ path: String) {
         let enumerator = fileManager.enumerator(atPath: path)
-        
         while let element = enumerator?.nextObject() as? String {
-            if !shouldSkip(element) {
-                let itemPath = path.appending(element)
-                
-                var isDir: ObjCBool = false
-                if fileManager.fileExists(atPath: itemPath, isDirectory: &isDir) {
-                    if !isDir.boolValue {
-                        updateContentsOfFile(atPath: itemPath)
-                    }
-                }
-
-                renameItem(atPath: itemPath)
+            let itemPath = path.appending("/\(element)")
+            if !processedPaths.contains(itemPath) && !shouldSkip(element) {
+                processPath(itemPath)
             }
         }
     }
     
+    private func processPath(_ path: String) {
+        print("\(Color.DarkGray)Processing: \(path)")
+        
+        var isDir: ObjCBool = false
+        if fileManager.fileExists(atPath: path, isDirectory: &isDir) {
+            if isDir.boolValue {
+                enumeratePath(path)
+            } else {
+                updateContentsOfFile(atPath: path)
+            }
+            renameItem(atPath: path)
+        }
+        
+        processedPaths.append(path)
+    }
+    
     private func shouldSkip(_ element: String) -> Bool {
-        guard !element.contains(".DS_Store") else { return true }
+        guard
+            !element.hasPrefix("."),
+            !element.contains(".DS_Store"),
+            !element.contains("Carthage"),
+            !element.contains("Pods"),
+            !element.contains("fastlane")
+        else { return true }
         
         let fileExtension = URL(fileURLWithPath: element).pathExtension
         switch fileExtension {

        static let Magenta = "\u{001B}[0;35m"
        static let Cyan = "\u{001B}[0;36m"
        static let White = "\u{001B}[0;37m"
    }
    
    // MARK: - Properties
    
    let fileManager = FileManager.default
    
    let oldName: String
    let newName: String

    }
    
    private func updateContentsOfFile(atPath path: String) {
        do {
            let oldContent = try String(contentsOfFile: path, encoding: .utf8)
            if oldContent.contains(oldName) {
                let newContent = oldContent.replacingOccurrences(of: oldName, with: newName)
                try newContent.write(toFile: path, atomically: true, encoding: .utf8)
                print("\(Color.Blue)-- Updated: \(path)")
            }
        } catch {
            print("\(Color.Red)Error while updating file: \(error.localizedDescription)\n")
        }
    }
    
    private func renameItem(atPath path: String) {
        do {
            let oldItemName = URL(fileURLWithPath: path).lastPathComponent
            if oldItemName.contains(oldName) {
                let newItemName = oldItemName.replacingOccurrences(of: oldName, with: newName)
                let directoryURL = URL(fileURLWithPath: path).deletingLastPathComponent()
                let newPath = directoryURL.appendingPathComponent(newItemName).path
                try fileManager.moveItem(atPath: path, toPath: newPath)
                print("\(Color.Magenta)-- Renamed: \(oldItemName) -> \(newItemName)")
            }
        } catch {
            print("\(Color.Red)Error while renaming file: \(error.localizedDescription)")
        }
    }
    
}

let arguments = CommandLine.arguments
if arguments.count == 3 {
    let oldName = arguments[1]
    let newName = arguments[2].replacingOccurrences(of: " ", with: "")
