Further cleanup and internal docs.