Split out submodule cleanup steps.