Refactor wild card file matching.