Some smaller refactorings