refactored some of the structure of program
updated client class