There's a few things they both do, and to keep them in sync we should factor that stuff out to its own function called from both places.