A bit of clean-up to make it easier to reuse code.