refacorted tests