         if index == nil {
             return
         }
-        let cache = self.caches[index!]
-        self.caches.removeAtIndex(index!)
+        self.updateCacheIndex(index!)
+    }
+
+    private func updateCacheIndex(index :Int) {
+        let cache = self.caches[index]
+        self.caches.removeAtIndex(index)
         self.caches.insert(cache, atIndex: 0)
     }
 
     private func get(key :String, update :Bool) -> T? {
-        var caches :Array<Cache<T>>? = nil
-        caches = self.caches.filter { (cache :Cache<T>) -> Bool in
-            key == cache.key
-        }
-        if caches != nil && caches!.count > 0 {
-            if update {
-                self.updateCacheIndex(caches![0].key)
+        for (index, cache) in self.caches.enumerate() {
+            if key == cache.key {
+                if update {
+                    self.updateCacheIndex(index)
+                }
+                return cache.value
             }
-            return caches![0].value
         }
         return nil
     }

        }

        self.lock.lock()

        // validate existing
        if self.hasValue(key) == true {
            self.updateCacheIndex(key)
            self.lock.unlock()
            return true
        }

    }

    public func remove(key :String) {
        for (index, cache) in self.caches.enumerate() {
            if key == cache.key {
                self.caches.removeAtIndex(index)
                return
