[#52392535] Cleaned up a bit

The code is still ugly here though.