Get rid of some code duplication in SOACNest.