refactored custom search into a widget