Code structure improvements from review.