storage backup/restore code refactoring