Refactor out the DB access to a separate file.