Update after @spinscale review: move utility method to FileSystemUtils