Code cleanup & SOC