refatctor test