refactor how we store data in db