[ENHANCEMENT] Code cleanup, reformat and fixing some inspection issues