Some minor refactorings.