move submodule stuff into prepare()