make FileSystem functional style