Some more refactorings