Improvements and cleanup.