Internal refactoring