refactred tests