Some more minor refactoring.