Minor internal refactoring