minor renaming, documentation and cleanups.