[Misc] Tidy up the source code