Refactor file extension selection criteria to select files from any extension, passed by parameter