saving current progress converting example to more object oriented style