Refactored to be Object-Oriented.