Yet more refactoring.