Refractored code by adding 3 methods