Port more infrastructure for random instances