A bit more refactoring.