Some clean-up and fine-tuning