Refactoring of some tests