           return callback({message: "Blueprint file or files not found on path: '#{config.options.path}'"}, stats)
 
         # remove duplicate filenames
-        config.files = config.files.filter (item, pos) ->
-          return config.files.indexOf(item) == pos
+        config.files = removeDuplicates config.files
         cb()
-
 
     # load all files
     loadFiles = (cb) ->


glob = require 'glob'
fs = require 'fs'
clone = require 'clone'
protagonist = require 'protagonist'
async = require 'async'
request = require 'request'

    if not configDataIsEmpty
      config.data = passedConfigData

    # remove duplicate paths
    config.options.path = removeDuplicates config.options.path

    # expand all globs
    expandGlobs = (cb) ->
      async.each config.options.path, (globToExpand, globCallback) ->
