Move more peristence logic out of controllers.