Some tests refactoring