Refactor to use db.store