simplify and cleanup
further cleanup and doc improvements