Some cleanup and documenting.