Refractored and added better description