progress on code cleaning