refactor prove search