Minor clean-up and re-factoring.