more cleanup and commenting