extract this into a view helper method.