     /// - parameter query: The query to compare the database entities with
     /// - parameter sort: The order to sort the entities by
     public static func find(_ query: Query? = nil, sortedBy sort: Sort? = nil, skipping skip: Int? = nil, limitedTo limit: Int? = nil, withBatchSize batchSize: Int = 100) throws -> Cursor<Self> {
+        let prepared = try prepareQuery(query, sortedBy: sort, skipping: skip, limitedTo: limit)
+        let result = try runPreparedQuery(prepared, batchSize: batchSize)
+        
+        return try result.flatMap { document in
+            do {
+                return try Self.instantiateIfNeeded(document)
+            } catch {
+                Meow.log("Initializing from document failed: \(error)")
+                assertionFailure()
+                return nil
+            }
+        }
+    }
+    
+    /// Intantiates this instance if needed, or pulls the existing entity from memory when able
+    public static func instantiateIfNeeded(_ document: Document) throws -> Self {
+        return try Meow.pool.instantiateIfNeeded(type: Self.self, document: document)
+    }
+    
+    fileprivate static func runPreparedQuery(_ query: PreparedQuery, batchSize: Int = 100) throws -> Cursor<Document> {
+        switch query {
+        case .aggregate(let pipeline):
+            return try collection.aggregate(pipeline, options: [.cursorOptions(["batchSize": batchSize])])
+        case .find(let query, let sort, let skip, let limit, let project):
+            return try collection.find(query, sortedBy: sort, projecting: project, skipping: skip, limitedTo: limit, withBatchSize: batchSize).cursor
+        }
+    }
+    
+    fileprivate static func prepareQuery(_ query: Query? = nil, sortedBy sort: Sort? = nil, projecting projection: Projection? = nil, skipping skip: Int? = nil, limitedTo limit: Int? = nil) throws -> PreparedQuery {
         var pipeline = AggregationPipeline()
         var requirePipeline = false
         

            pipeline.append(.limit(limit))
        }
        
        return try collection.aggregate(pipeline).flatMap { document in
            do {
                return try Self.instantiateIfNeeded(document)
            } catch {
                Meow.log("Initializing from document failed: \(error)")
                assertionFailure()
                return nil
            }
        }
    }
    
    /// Intantiates this instance if needed, or pulls the existing entity from memory when able
    public static func instantiateIfNeeded(_ document: Document) throws -> Self {
        return try Meow.pool.instantiateIfNeeded(type: Self.self, document: document)
    }
}

        }
        
        if !requirePipeline {
            return .find(query: query, sort: sort, skip: skip, limit: limit, project: projection)
        }
        
        if let sort = sort {
