Refactored the StateTests