refactor normalizeFiles