Began good refactoring