A little internal refactoring