refactored getFile() in IterateDirectoriesImpl to be smaller and clearer