Some refactoring in unittest in order to simplify them