Some more refactorings.