Some more minor refactorings