4eafedb20f
There has been lots of duplicated code between those two, and the recent changed introduced even more copy/paste code. This commit consolidates both implementations. The two "public" entry points, `CreateExternalGear` and `CreateInternalGear` have been kept and now call a shared helper.