Minor tweaks starting to pull db stuff out of controllers.