First refactor of filesystem provider for more consistent functions.