<div id="comment:0"></div> (partially cherry-picked from #32432) CC: @tscrim @kliem Component: **refactoring** Author: **Matthias Koeppe** Branch/Commit: **[`73aabd2`](https://github.com/sagemath/sagetrac-mirror/commit/73aabd22000d7703710df29ad89434d790d4e6b6)** Reviewer: **Travis Scrimshaw** _Issue created by migration from https://trac.sagemath.org/ticket/32599_