function performFileRemove(step, task, results) {
  var options = xcode(step.options, true);

  resolveFuture(options, results);

  return storeOldFile(task, step).then(function (file) {
    return updateState(task, step.index, PENDING).then(function () {
      var chain = Promise.resolve();

      if (!file) {
        results.push(null);
      }
      else{
        var gfs = Grid(mongoose.connection.db);

        chain = dbUtils.removeFile(options, gfs).then(function (result) {
          results.push(result);
        });
      }

      return chain.then(function () {
        return updateState(task, step.index, DONE, results);
      });
    });
  });
}
This function handles the file remove step.

@param step the file remove step
@param task the task which step belongs to
@param results array of results from previous operations

@returns {Promise|*}