refactor the db save and fs store