Started refactoring