     static var sharedInstance = Formatter()
     private static let pathExtension = "SwiftLintXcode"
 
-    let fileManager = NSFileManager.defaultManager()
-    let tempDirURL: NSURL = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("SwiftLintXcode-\(NSUUID().UUIDString)")
+    private let fileManager = NSFileManager.defaultManager()
 
-    struct CursorPosition {
+    private struct CursorPosition {
         let line: Int
         let column: Int
     }
-
 
     class func isFormattableDocument(document: NSDocument) -> Bool {
         return (document.fileURL?.pathExtension?.lowercaseString == "swift") ?? false

    }

    private func createTemporaryPath() -> String {
        return tempDirURL.URLByAppendingPathComponent(NSUUID().UUIDString).path! + ".swift"
    }

    private func ensureTemporaryDirectory() throws {
        if fileManager.fileExistsAtPath(tempDirURL.path!) { return }
        try fileManager.createDirectoryAtURL(tempDirURL, withIntermediateDirectories: true, attributes: nil)
    }
}

    }

    private func withTempporaryFile<T>(@noescape callback: (filePath: String) throws -> T) throws -> T {
        let filePath = createTemporaryPath()
        if fileManager.fileExistsAtPath(filePath) {
            throw NSError(domain: "net.ypresto.SwiftLintXcode", code: 0, userInfo: [
