Move blog logic out of controller.