Minor restructuring and clean-up