Round 1 of refactoring