Code cleanup + getting in line with standards