Refactor to make user search widget generic