             json = json.splice(0, Math.min(json.length, @_cursor.$limit))
           callback()
 
-        queue.defer (callback) => @_fetchIncludes(json, callback)
+        queue.defer (callback) => @fetchIncludes(json, callback)
 
       queue.await =>
         return callback(null, (if _.isArray(json) then !!json.length else json)) if exists
-
-        # only select specific fields
-        if @_cursor.$values
-          $fields = if @_cursor.$white_list then _.intersection(@_cursor.$values, @_cursor.$white_list) else @_cursor.$values
-        else if @_cursor.$select
-          $fields = if @_cursor.$white_list then _.intersection(@_cursor.$select, @_cursor.$white_list) else @_cursor.$select
-        else if @_cursor.$white_list
-          $fields = @_cursor.$white_list
-        json = _.map(json, (data) -> _.pick(data, $fields)) if $fields
-
         return callback(null, if json.length then json[0] else null) if @_cursor.$one
 
-        # TODO: OPTIMIZE TO REMOVE 'id' and '_rev' if needed
-        if @_cursor.$values
-          $values = if @_cursor.$white_list then _.intersection(@_cursor.$values, @_cursor.$white_list) else @_cursor.$values
-          if @_cursor.$values.length is 1
-            key = @_cursor.$values[0]
-            json = if $values.length then ((if data.hasOwnProperty(key) then data[key] else null) for data in json) else _.map(json, -> null)
-          else
-            json = (((data[key] for key in $values when data.hasOwnProperty(key))) for data in json)
-        else if @_cursor.$select
-          $select = if @_cursor.$white_list then _.intersection(@_cursor.$select, @_cursor.$white_list) else @_cursor.$select
-          json = _.map(json, (data) => _.pick(data, $select))
-        else if @_cursor.$white_list
-          json = _.map(json, (data) => _.pick(data, @_cursor.$white_list))
-
+        json = @selectResults(json, callback)
         if @_cursor.$page or (@_cursor.$page is '')
-          json =
+          callback(null, {
             offset: @_cursor.$offset
             total_rows: @_count(find_query, keys)
             rows: json
-
-        callback(null, json)
+          })
+        else
+          callback(null, json)
+
       return # terminating
 
-  _count: (find_query, keys) ->
-    if keys.length
-      return _.reduce(@store, ((memo, model_json) => return if _.isEqual(_.pick(model_json, keys), find_query) then memo + 1 else memo), 0)
-    else
-      return _.size(@store)
-
-  _valueIsMatch: (find_query, key_path, model_json, callback) ->
-    key_components = key_path.split('.')
-    model_type = @model_type
-
-    next = (err, models_json) =>
-      return callback(err) if err
-      key = key_components.shift()
-
-      # done conditions
-      unless key_components.length
-        was_handled = false
-        find_value = find_query[key_path]
-
-        models_json = [models_json] unless _.isArray(models_json)
-        for model_json in models_json
-          model_value = model_json[key]
-          # console.log "\nChecking value (#{key_path}): #{key}, find_value: #{util.inspect(find_value)}, model_value: #{util.inspect(model_value)}\nmodel_json: #{util.inspect(model_json)}\nis equal: #{_.isEqual(model_value, find_value)}"
-
-          # an object might specify $lt, $lte, $gt, $gte, $ne
-          if _.isObject(find_value)
-            for operator in IS_MATCH_OPERATORS when find_value.hasOwnProperty(operator)
-              # console.log "Testing operator: #{operator}, model_value: #{util.inspect(model_value)}, test_value: #{util.inspect(find_value[operator])} result: #{IS_MATCH_FNS[operator](model_value, find_value[operator])}"
-              was_handled = true
-              break if not is_match = IS_MATCH_FNS[operator](model_value, find_value[operator])
-
-          if was_handled
-            return callback(null, is_match) if is_match
-          else if is_match = _.isEqual(model_value, find_value)
-            return callback(null, is_match)
-
-        # checked all models and none were a match
-        return callback(null, false)
-
-      # console.log "\nNext model (#{key_path}): #{key} model_json: #{util.inspect(model_json)}"
-
-      # fetch relation
-      return relation.cursor(model_json, key).toJSON(next) if (relation = model_type.relation(key)) and not relation.embed
-      next(null, model_json[key])
-
-    next(null, model_json) # start checking
-
-  _buildFindQuery: (callback) ->
+  buildFindQuery: (callback) ->
     queue = new Queue()
 
     find_query = {}

        return callback(null, json_count)

      queue.defer (callback) =>

        # use find
        if keys.length or ins_size

            callback()

    load_queue.await callback

  selectResults: (json, callback) ->
    # TODO: OPTIMIZE TO REMOVE 'id' and '_rev' if needed
    if @_cursor.$values
      $values = if @_cursor.$white_list then _.intersection(@_cursor.$values, @_cursor.$white_list) else @_cursor.$values
      if @_cursor.$values.length is 1
        key = @_cursor.$values[0]
        json = if $values.length then ((if item.hasOwnProperty(key) then item[key] else null) for item in json) else _.map(json, -> null)
      else
        json = (((item[key] for key in $values when item.hasOwnProperty(key))) for item in json)
    else if @_cursor.$select
      $select = if @_cursor.$white_list then _.intersection(@_cursor.$select, @_cursor.$white_list) else @_cursor.$select
      json = _.map(json, (item) => _.pick(item, $select))

    else if @_cursor.$white_list
      json = _.map(json, (item) => _.pick(item, @_cursor.$white_list))
    return json

  ##########################################
  # Internal
  ##########################################
  _count: (find_query, keys) ->
    if keys.length
      json_count = _.reduce(@store, ((memo, model_json) => return if _.isEqual(_.pick(model_json, keys), find_query) then memo + 1 else memo), 0)
    else
      json_count = _.size(@store)

  _valueIsMatch: (find_query, key_path, model_json, callback) ->
    key_components = key_path.split('.')
    model_type = @model_type

    next = (err, models_json) =>
      return callback(err) if err
      key = key_components.shift()

      # done conditions
      unless key_components.length
        was_handled = false
        find_value = find_query[key_path]

        models_json = [models_json] unless _.isArray(models_json)
        for model_json in models_json
          model_value = model_json[key]
          # console.log "\nChecking value (#{key_path}): #{key}, find_value: #{util.inspect(find_value)}, model_value: #{util.inspect(model_value)}\nmodel_json: #{util.inspect(model_json)}\nis equal: #{_.isEqual(model_value, find_value)}"

          # an object might specify $lt, $lte, $gt, $gte, $ne
          if _.isObject(find_value)
            for operator in IS_MATCH_OPERATORS when find_value.hasOwnProperty(operator)
              # console.log "Testing operator: #{operator}, model_value: #{util.inspect(model_value)}, test_value: #{util.inspect(find_value[operator])} result: #{IS_MATCH_FNS[operator](model_value, find_value[operator])}"
              was_handled = true
              break if not is_match = IS_MATCH_FNS[operator](model_value, find_value[operator])

          if was_handled
            return callback(null, is_match) if is_match
          else if is_match = _.isEqual(model_value, find_value)
            return callback(null, is_match)

        # checked all models and none were a match
        return callback(null, false)

      # console.log "\nNext model (#{key_path}): #{key} model_json: #{util.inspect(model_json)}"

      # fetch relation
      return relation.cursor(model_json, key).toJSON(next) if (relation = model_type.relation(key)) and not relation.embed
      next(null, model_json[key])

    next(null, model_json) # start checking
