minor improvements and cleanup