Refactoring searchWidgetRender in renderSearchWidget. And changed pgs
that use it.