 
 import Foundation
 
-private var varsRegExpr: NSRegularExpression!
-private var colorRegExpr: NSRegularExpression!
-private var linearGradRegExpr: NSRegularExpression!
-private var patternRegExpr: NSRegularExpression!
-private var imageRegExpr: NSRegularExpression!
-
 extension NSDictionary {
     
-    // MARK: Initialization
-    
-    /// Initialize `NSRegularExpression`
-    open override class func initialize() {
-        // Regular expression for user theme variables ($var)
-        do {
-            varsRegExpr = try NSRegularExpression.init(pattern: "(\\$[a-zA-Z0-9_\\-\\.]+)+", options: .caseInsensitive)
-        }
-        catch let error {
-            print(error)
-        }
-        
-        // Regular expression for user theme colors
-        do {
-            colorRegExpr = try NSRegularExpression.init(pattern: "(?:rgba?)?[\\s]?[\\(]?[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?([0-1]?(?:\\.\\d+)?)", options: .caseInsensitive)
-        }
-        catch let error {
-            print(error)
-        }
-        
-        // Regular expression for user theme gradients
-        do {
-            linearGradRegExpr = try NSRegularExpression.init(pattern: "linear-gradient\\(\\s*((?:rgba?)?[\\s]?[\\(]?[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]*[\\s+]?([0-1]?(?:\\.\\d+)?)\\))\\s*,\\s*((?:rgba?)?[\\s]?[\\(]?[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]*[\\s+]?([0-1]?(?:\\.\\d+)?)\\))\\s*\\)", options: .caseInsensitive)
-        }
-        catch let error {
-            print(error)
-        }
-        
-        // Regular expression for user theme pattern images (NSColor)
-        do {
-            patternRegExpr = try NSRegularExpression.init(pattern: "pattern\\(((named):[\\s]*([\\w-\\. ]+)|(file):[\\s]*([\\w-\\. \\/]+))\\)", options: .caseInsensitive)
-        } catch let error {
-            print(error)
-        }
-        
-        // Regular expression for user theme images
-        do {
-            imageRegExpr = try NSRegularExpression.init(pattern: "image\\(((named):[\\s]*([\\w-\\. ]+)|(file):[\\s]*([\\w-\\. \\/]+))\\)", options: .caseInsensitive)
-        } catch let error {
-            print(error)
-        }
-    }
+    // MARK: `NSRegularExpression` Initialization
+    
+    /// Regular expression for user theme variables ($var)
+    static var varsRegExpr: NSRegularExpression? {
+        do {
+            return try NSRegularExpression.init(pattern: "(\\$[a-zA-Z0-9_\\-\\.]+)+", options: .caseInsensitive)
+        }
+        catch let error {
+            print(error)
+            return nil
+        }
+    }
+    
+    /// Regular expression for user theme colors
+    static var colorRegExpr: NSRegularExpression? {
+        do {
+            return try NSRegularExpression.init(pattern: "(?:rgba?)?[\\s]?[\\(]?[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?([0-1]?(?:\\.\\d+)?)", options: .caseInsensitive)
+        }
+        catch let error {
+            print(error)
+            return nil
+        }
+    }
+    
+    /// Regular expression for user theme gradients
+    static var linearGradRegExpr: NSRegularExpression? {
+        do {
+            return try NSRegularExpression.init(pattern: "linear-gradient\\(\\s*((?:rgba?)?[\\s]?[\\(]?[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]*[\\s+]?([0-1]?(?:\\.\\d+)?)\\))\\s*,\\s*((?:rgba?)?[\\s]?[\\(]?[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]+[\\s+]?(\\d+)[(\\s)|(,)]*[\\s+]?([0-1]?(?:\\.\\d+)?)\\))\\s*\\)", options: .caseInsensitive)
+        }
+        catch let error {
+            print(error)
+            return nil
+        }
+    }
+    
+    /// Regular expression for user theme pattern images (NSColor)
+    static var patternRegExpr: NSRegularExpression? {
+        do {
+            return try NSRegularExpression.init(pattern: "pattern\\(((named):[\\s]*([\\w-\\. ]+)|(file):[\\s]*([\\w-\\. \\/]+))\\)", options: .caseInsensitive)
+        }
+        catch let error {
+            print(error)
+            return nil
+        }
+    }
+    
+    /// Regular expression for user theme images
+    static var imageRegExpr: NSRegularExpression? {
+        do {
+            return try NSRegularExpression.init(pattern: "image\\(((named):[\\s]*([\\w-\\. ]+)|(file):[\\s]*([\\w-\\. \\/]+))\\)", options: .caseInsensitive)
+        }
+        catch let error {
+            print(error)
+            return nil
+        }
+    }
+    
     
     // MARK: Evaluation
     

        return evaluatedObjectAsThemeAsset(value: stringValue as AnyObject)
    }
    
    // MARK: Internal evaluation functions
    
    /// Evaluate object for the specified key as string.

            // pattern
            if (object is String) {
                var stringValue = (object as! String)
                let match = NSDictionary.patternRegExpr?.firstMatch(in: stringValue, options:NSRegularExpression.MatchingOptions(rawValue: UInt(0)), range: NSMakeRange(0, stringValue.characters.count))
                if match?.numberOfRanges == 6 {
                    let isNamedType = stringValue.substring(withNSRange: match!.rangeAt(2)) == "named"
                    let imageName = stringValue.substring(withNSRange: match!.rangeAt(3))
