Simplified test syntax. Added util function for tests.