factor out testing from RG impl