rafactored tests