improvements and cleanup