Plenty more code cleanup