Code and document clean up