Pulled out methods to allow filesystem replacement