beginnings of refactoring to be object oriented