move test helper function to test file