extract this out of the view