Part of the cleanup in #3637
Part of https://gitlab.com/kicad/code/kicad/issues/3637
Part of fixing https://gitlab.com/kicad/code/kicad/issues/3637