Some tets refactoring.