Refactor file names filtering