Refactoring internal structure