cleanup and doc comments