More minor refactoring