refactor validate tests