refactor the search/show to command to use common code path