more cutting of unneeded code
reduce runtime for ref_guided_diversity [ci skip]