Further Code Cleanup and Documentation.