refactory test