main code update

instead of making a method for each object , i did an only method with a
String argument that is use as a reference to change the object type.