Minor restructure to allow new `remove_section` dialog to use the same code.