Some more refactoring.