refractored 100%