removing closure and using FilenameUtils