making the program more OO