refacotring tests