more documentation and cleanup