refractoring

creating and explaining the new changes in the code