Pull out connection to db so it only occurs once.