db related code to go in db manager