refactor those random tests