exclude: split pathname matching code into a separate function