Slight refactoring of require C++ code.