Some small refactorings