The current code is very K&R C heavy and hard to read with a modern mindset. I'm not sure if clang-format or something could do this job for us.