Minor internal refactoring.