Some small refactorings.