More work on refactoring. Folder storage seems to work now.