internal improvements and doc changes.