Refactoring to take advantage of object oriented structure.