Some cleanup and commenting.