refractored test