factor out test states