Updated the Refractored Code