a bit of cleanup and doc