cleanup and more documentation