Documentation update and code cleanup.