improvements and tuning