remove duplicated code across test files