More minor refactorings