Refactored into an object oriented solution.