I am certain this should be extracted to a view.