cleanup and document