Removed the excess variables and renamed one parameter of a method