Refactor FileSystem functions into separate class