         self.entries = [:]
     }
 
-    private func updateFifo(key: String, valueRef: Ref<T>?) {
+    private func updateFifo(key: String, valueRef: Ref<T>) {
         self.fifo.append((key: key, valueRef: valueRef))
         if self.fifo.count >= self.size * self.gcFactor {
-            var newFifo: [(key: String, valueRef: Ref<T>?)] = []
+            var newFifo: [(key: String, valueRef: Ref<T>)] = []
             var need = self.entries
             while need.count > 0 {
                 let fifoEntry = self.fifo.removeLast()

public class Siegel<T> {
    private let size: Int
    private let gcFactor: Int
    private var fifo: [(key: String, valueRef: Ref<T>?)]
    private var entries: [String: Weak<Ref<T>>?]

    public init(size: Int = 1024, gcFactor: Int = 10) {
        self.size     = size


    public func get(#key: String) -> T? {
        if let weakValueRef = self.entries[key] {
            self.updateFifo(key, valueRef: weakValueRef.value!)
            return weakValueRef.value?.value
        }
        return nil
    }

    public func remove(#key: String) -> T? {
        return self.entries.removeValueForKey(key)?.value?.value
    }

    public func clear() {
