cleanup and doc