     public func find<T: Storable>(_: T.Type, id: Int) -> T? {
         var result: T?
         
-        dispatch_sync(queue) { [weak self] in
+        synchronizeDBRead { [weak self] in
             guard let weakSelf = self else { return }
             
             result = weakSelf.lookup(T).value.filter{ $0.id == id }.flatMap{ $0 as? T }.first

public class KakapoDB {
    
    private let queue = dispatch_queue_create("com.kakapodb.queue", DISPATCH_QUEUE_CONCURRENT)
    private var _uuid = -1
    private var store: [String: ArrayBox<Storable>] = [:]
    
    public func create<T: Storable>(_: T.Type, number: Int = 1) -> [T] {
        var result = [T]()
        
        dispatch_barrier_sync(queue) {
            result = (0..<number).map { _ in T(id: self.uuid(), db: self) }
            self.lookup(T).value.appendContentsOf(result.flatMap{ $0 as Storable })
        }

    
    public func insert<T: Storable>(handler: (Int) -> T) -> T {
        var obj: T? = nil
        synchronizeDBWrite {
            let potentialId = self._uuid + 1
            let object = handler(potentialId)
            obj = object
