Completely restructure program into OOP style.