Major code cleanup ctd.