Structure refactored to object oriented.