factorize search