A bit of code cleanup and coding style adaption