Brushing the code up slightly