refactored filesystem storage (so ftp can use some of the same code)