some cleanup and doc