Started refactoring into base class/subclass hierarchy